package com.oocl.analyze;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Analyze {
	public static final String NUMBER = "\\d";
	public static final String LETTER = "[a-zA-Z]";
	public static final String CHINESE = "[\u4e00-\u9fa5]";
	public static final String PUNCTUATION = "[\\pP\\pS\\pZ]";
	public static final String EMIAL = "";
	public static final String SEX = "";
	
	public int analyzeWord(String regx,String string){
		Pattern mPattern = Pattern.compile(regx);
		Matcher matcher = mPattern.matcher(string);
		int length = 0;
		while(matcher.find()){
			length++;
		}
		return length;
	}
	public boolean analyzeCorrectness(String regx,String string){
		Pattern mPattern = Pattern.compile(regx);
		Matcher matcher = mPattern.matcher(string);
		int length = 0;
		while(matcher.find()){
			length++;
		}
		return length > 0 ? true:false;
	}
	
}
